package com.yf1706.bean;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.Date;


/**
 * The persistent class for the emp_detail_info database table.
 * 
 */
@Entity
@Table(name="emp_detail_info")
@NamedQuery(name="EmpDetailInfo.findAll", query="SELECT e FROM EmpDetailInfo e")
public class EmpDetailInfo implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private int id;

	@Column(name="nationality")
	private String nationality;

	@Temporal(TemporalType.DATE)
	private Date birthday;

	@Temporal(TemporalType.DATE)
	@JSONField(format="yyyy-MM-dd")
	@Column(name="corrected_date")
	private Date correctedDate;
	
	@ManyToOne
	@JoinColumn(name="education_id")
	private EducationSetting educationSetting;

	@ManyToOne
	@JoinColumn(name="health_id")
	private HealthSetting healthSetting;

	@Temporal(TemporalType.DATE)
	@JSONField(format="yyyy-MM-dd")
	@Column(name="hire_date")
	private Date hireDate;

	@Column(name="id_card")
	private String idCard;

	@Column(name="marital_status")
	private String maritalStatus;

	@ManyToOne
	@JoinColumn(name="nation_id")
	private NationSetting nationSetting;

	@ManyToOne
	@JoinColumn(name="political_id")
	private PoliticalSetting politicalSetting;

	@Temporal(TemporalType.DATE)
	@JSONField(format="yyyy-MM-dd")
	@Column(name="resign_date")
	private Date resignDate;

	@ManyToOne
	@JoinColumn(name="sex_id")
	private SexSetting sexSetting;

	//bi-directional one-to-one association to Emp
	@OneToOne
	@JSONField(serialize = false)
	@JoinColumn(name="emp_id")
	private Emp emp;

	public EmpDetailInfo() {
	}


	@Override
	public String toString() {
		return "EmpDetailInfo [id=" + id + ", nationality=" + nationality + ", birthday=" + birthday
				+ ", correctedDate=" + correctedDate + ", educationSetting=" + educationSetting + ", healthSetting="
				+ healthSetting + ", hireDate=" + hireDate + ", idCard=" + idCard + ", maritalStatus=" + maritalStatus
				+ ", nationSetting=" + nationSetting + ", politicalSetting=" + politicalSetting + ", resignDate="
				+ resignDate + ", sexSetting=" + sexSetting + "]";
	}


	public int getId() {
		return id;
	}


	public void setId(int id) {
		this.id = id;
	}


	public String getNationality() {
		return nationality;
	}


	public void setNationality(String nationality) {
		this.nationality = nationality;
	}



	public Date getBirthday() {
		return this.birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public Date getCorrectedDate() {
		return this.correctedDate;
	}

	public void setCorrectedDate(Date correctedDate) {
		this.correctedDate = correctedDate;
	}


	public EducationSetting getEducationSetting() {
		return educationSetting;
	}


	public void setEducationSetting(EducationSetting educationSetting) {
		this.educationSetting = educationSetting;
	}


	public HealthSetting getHealthSetting() {
		return healthSetting;
	}


	public void setHealthSetting(HealthSetting healthSetting) {
		this.healthSetting = healthSetting;
	}


	public NationSetting getNationSetting() {
		return nationSetting;
	}


	public void setNationSetting(NationSetting nationSetting) {
		this.nationSetting = nationSetting;
	}


	public PoliticalSetting getPoliticalSetting() {
		return politicalSetting;
	}


	public void setPoliticalSetting(PoliticalSetting politicalSetting) {
		this.politicalSetting = politicalSetting;
	}


	public SexSetting getSexSetting() {
		return sexSetting;
	}


	public void setSexSetting(SexSetting sexSetting) {
		this.sexSetting = sexSetting;
	}


	public Date getHireDate() {
		return this.hireDate;
	}

	public void setHireDate(Date hireDate) {
		this.hireDate = hireDate;
	}

	public String getIdCard() {
		return this.idCard;
	}

	public void setIdCard(String idCard) {
		this.idCard = idCard;
	}

	public String getMaritalStatus() {
		return this.maritalStatus;
	}

	public void setMaritalStatus(String maritalStatus) {
		this.maritalStatus = maritalStatus;
	}


	public Date getResignDate() {
		return this.resignDate;
	}

	public void setResignDate(Date resignDate) {
		this.resignDate = resignDate;
	}


	public Emp getEmp() {
		return this.emp;
	}

	public void setEmp(Emp emp) {
		this.emp = emp;
	}

}